/*
 *
 *      Copyright (c) 2018-2025, pandaf All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the pig4cloud.com developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: pandaf
 *
 */

package cn.s1995.sloth.admin.api.feign;

import cn.s1995.sloth.admin.api.dto.ProcessFileDTO;
import cn.s1995.sloth.common.core.constant.SecurityConstants;
import cn.s1995.sloth.common.core.constant.ServiceNameConstants;
import cn.s1995.sloth.common.core.util.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.net.URL;

/**
 * @author pandaf
 * @date 2018/6/28
 */
@FeignClient(contextId = "remoteSysFileService", value = ServiceNameConstants.UPMS_SERVICE)
public interface RemoteSysFileService {

    @GetMapping("/sys-file/url")
    R<URL> getUrl(@RequestParam(name = "dir", required = false) String dir,
                  @RequestParam("fileName") String fileName,
                  @RequestHeader(SecurityConstants.FROM) String from);

    @PostMapping("/sys-file/extract-frame-alioss")
    R extractFrameForAliOss(@RequestBody ProcessFileDTO dto,
                            @RequestHeader(SecurityConstants.FROM) String from);

    @PostMapping("/sys-file/extract-frame")
    R extractFrame(@RequestBody ProcessFileDTO dto,
                   @RequestHeader(SecurityConstants.FROM) String from);
}
